package com.micro.entity;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableField;

@TableName("酒店订单")
public class HotelOrder {

    @TableId(value = "订单id", type = IdType.AUTO)
    private Long orderId;

    @TableField("用户ID")
    private Long userId;

    @TableField("酒店ID")
    private Long hotelId;

    @TableField("入住日期")
    private LocalDate checkInDate;

    @TableField("退房日期")
    private LocalDate checkOutDate;

    @TableField("订单状态")
    private OrderStatus orderStatus = OrderStatus.已预订;

    @TableField("支付金额")
    private BigDecimal paymentAmount;

    @TableField("支付方式")
    private String paymentMethod;

    @TableField("支付时间")
    private LocalDateTime paymentTime;

    @TableField("退款金额")
    private BigDecimal refundAmount;

    @TableField("退款时间")
    private LocalDateTime refundTime;

    @TableField("更新时间")
    private LocalDateTime updateTime = LocalDateTime.now();

    @TableField("过期时间")
    private LocalDateTime expireTime;

    // 非数据库字段，用于显示
    @TableField(exist = false)
    private String hotelName;

    @TableLogic
    @TableField("deleted")
    private Integer deleted;

    // 订单状态枚举
    public enum OrderStatus {
        已预订, 已入住, 已退款
    }

    // 构造函数
    public HotelOrder() {}

    // Getter和Setter方法
    public Long getOrderId() {
        return orderId;
    }

    public void setOrderId(Long orderId) {
        this.orderId = orderId;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Long getHotelId() {
        return hotelId;
    }

    public void setHotelId(Long hotelId) {
        this.hotelId = hotelId;
    }

    public LocalDate getCheckInDate() {
        return checkInDate;
    }

    public void setCheckInDate(LocalDate checkInDate) {
        this.checkInDate = checkInDate;
    }

    public LocalDate getCheckOutDate() {
        return checkOutDate;
    }

    public void setCheckOutDate(LocalDate checkOutDate) {
        this.checkOutDate = checkOutDate;
    }

    public OrderStatus getOrderStatus() {
        return orderStatus;
    }

    public void setOrderStatus(OrderStatus orderStatus) {
        this.orderStatus = orderStatus;
    }

    public BigDecimal getPaymentAmount() {
        return paymentAmount;
    }

    public void setPaymentAmount(BigDecimal paymentAmount) {
        this.paymentAmount = paymentAmount;
    }

    public String getPaymentMethod() {
        return paymentMethod;
    }

    public void setPaymentMethod(String paymentMethod) {
        this.paymentMethod = paymentMethod;
    }

    public LocalDateTime getPaymentTime() {
        return paymentTime;
    }

    public void setPaymentTime(LocalDateTime paymentTime) {
        this.paymentTime = paymentTime;
    }

    public BigDecimal getRefundAmount() {
        return refundAmount;
    }

    public void setRefundAmount(BigDecimal refundAmount) {
        this.refundAmount = refundAmount;
    }

    public LocalDateTime getRefundTime() {
        return refundTime;
    }

    public void setRefundTime(LocalDateTime refundTime) {
        this.refundTime = refundTime;
    }

    public LocalDateTime getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(LocalDateTime updateTime) {
        this.updateTime = updateTime;
    }

    public LocalDateTime getExpireTime() {
        return expireTime;
    }

    public void setExpireTime(LocalDateTime expireTime) {
        this.expireTime = expireTime;
    }

    public String getHotelName() {
        return hotelName;
    }

    public void setHotelName(String hotelName) {
        this.hotelName = hotelName;
    }

    public Integer getDeleted() {
        return deleted;
    }

    public void setDeleted(Integer deleted) {
        this.deleted = deleted;
    }
}
